package org.sk.gsync.app.spring;

import org.sk.gsync.ui.LoginDialog;
import org.sk.gsync.ui.Principal;
import org.sk.gsync.ui.SaveCancelButtonsPanel;
import org.sk.gsync.ui.configuration.ConfigurationFrame;
import org.sk.gsync.ui.configuration.ConfigurationFrameContext;
import org.sk.gsync.ui.configuration.SelectPathPanel;
import org.sk.gsync.ui.context.LoginDialogContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GuiSpringConfig {

    @Bean(name = "loginDialog", initMethod = "configure")
    public LoginDialog getLoginDialog() {
        return new LoginDialog();
    }

    @Bean(name = "loginDialogContext")
    public LoginDialogContext getLoginDialogContext() {
        return new LoginDialogContext();
    }

    @Bean(name = "configurationFrameContext", initMethod = "load")
    public ConfigurationFrameContext getConfigurationFrameContext() {
        return new ConfigurationFrameContext();
    }

    @Bean(name = "principal", initMethod = "configure")
    public Principal getPrincipal() {
        return new Principal();
    }

    @Bean(name = "selectPathPanel", initMethod = "configure")
    public SelectPathPanel getSelectPathPanel() {
        return new SelectPathPanel();
    }

    @Bean(name = "saveCancelButtonsPanel", initMethod = "configure")
    public SaveCancelButtonsPanel getSaveCancelButtonsPanel() {
        return new SaveCancelButtonsPanel();
    }

    @Bean(name = "configurationFrame", initMethod = "configure")
    public ConfigurationFrame getConfigurationFrame() {
        return new ConfigurationFrame();
    }

}
